local huanglong = fk.CreateSkill{
    name = "wk_heg__huanglong",
    tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
    ["wk_heg__huanglong"] = "黄龙",
    [":wk_heg__huanglong"] = "锁定技，若存在拥有〖嘉禾〗的角色，你令其失去〖烽火〗的条件删去“受到锦囊牌造成的伤害后”，否则你视为拥有〖嘉禾〗。",

    ["@@wk_heg__huanglong_skill"] = "黄龙 拥有技能",
    ["@@wk_heg__huanglong_change"] = "黄龙 加强技能",
}

local huanglong_spec = {
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    local has_jiahe = false
    local targets = table.filter(player.room.alive_players, function(p) return p:hasSkill("jiahe") end)
    if #targets > 0 then
      has_jiahe = true
    end
    if player:hasSkill(huanglong.name) then
      room:handleAddLoseSkills(player, has_jiahe and "-wk_heg__jiahe" or "wk_heg__jiahe", nil, false, true)
      room:handleAddLoseSkills(player, has_jiahe and "-#wk_heg__fenghuotu" or "#wk_heg__fenghuotu", nil, false, true)
      room:setPlayerMark(player, "@@wk_heg__huanglong_skill", has_jiahe and 0 or 1)
      room:setPlayerMark(player, "@@wk_heg__huanglong_change", has_jiahe and 1 or 0)
    end
  end,
}

huanglong:addEffect(fk.EventAcquireSkill,{
    can_refresh = function (self, event, target, player, data)
       return data.skill.name == huanglong.name or data.skill.name == "jiahe"
    end,
    on_refresh = huanglong_spec.on_refresh,
})

huanglong:addEffect(fk.EventLoseSkill,{
    can_refresh = function (self, event, target, player, data)
       return data.skill.name == huanglong.name or data.skill.name == "jiahe"
    end,
    on_refresh = huanglong_spec.on_refresh,
})

huanglong:addEffect(fk.Deathed,{
    anim_type = "special",
    can_refresh = function (self, event, target, player, data)
       return target:hasSkill("jiahe", true, true)
    end,
    on_refresh = huanglong_spec.on_refresh,
})

return huanglong